/*
* @Author: zhanghang
* @Date:   2018-05-20 14:53:53
* @Last Modified by:   zhanghang
* @Last Modified time: 2018-05-20 15:31:16
*/
const LOGIN = 'LOGIN'
const LOGOUT = 'LOGOUT'



export function auth(state={isAuth: false,user: '李云龙'},action) {
    switch(action.type){
        case LOGIN: 
        return {...state,isAuth:true}
        case LOGOUT: 
        return {...state,isAuth:false}
        default:
        return state 
    }
}

//ACTION 
export function login() {
    return {type: LOGIN}
}

export function logout() {
    return {type: LOGOUT}
}